<?php
    // +----------------------------------------------------------------------
    // | 海豚PHP框架 [ DolphinPHP ]
    // +----------------------------------------------------------------------
    // | 版权所有 2016~2017 河源市卓锐科技有限公司 [ http://www.zrthink.com ]
    // +----------------------------------------------------------------------
    // | 官方网站: http://dolphinphp.com
    // +----------------------------------------------------------------------
    // | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
    // +----------------------------------------------------------------------

    namespace app\member\validate;

    use think\Validate;

    /**
     * Auth验证器
     * Class Auth
     *
     * @package app\member\validate
     */
    class Member extends Validate
    {

        //定义验证规则
        protected $rule = [
            'nickName|昵称'           => 'require|length:1,64',
            'avatar|头像'             => 'require|number',
            'phone|手机号'             => 'require|number|regex:^1\d{10}|unique:member',
            'validate_code|验证码'     => 'require|number|length:6,6',
            'referrer_phone|推荐人手机号' => 'number|regex:^1\d{10}',
            'alipay'                => 'pay',
            'alipay_qr'             => 'pay',
            'wxpay'                 => 'pay',
            'wxpay_qr'              => 'pay',
            'bank_name'             => 'pay',
            'bank_number'           => 'pay',
            'card_name'           => 'pay',

        ];

        //定义验证提示
        protected $message = [


        ];

        //定义验证场景
        protected $scene = [
            //登录
            'setavatar'   => ['avatar'],
            'setinfo'     => ['nickName'],
            'set_payinfo' => ['validate_code','alipay','alipay_qr','wxpay','wxpay_qr','bank_name','bank_number','card_name'],
        ];

        protected function pay(){
            return true;
        }


    }
